Title Banner

Previous Book Contents Book Index Next

Inside Macintosh: QuickDraw GX Graphics /
Chapter 3 - Geometric Styles / Geometric Styles Reference
Functions / Getting and Setting Patterns


GXGetStylePattern

You can use the GXGetStylePattern function to retrieve the pattern information from a style object.

gxPatternRecord *GXGetStylePattern(gxStyle source, 
                                   gxPatternRecord *pattern);
source
The style object whose pattern information you want to retrieve.
pattern
A pointer to a gxPatternRecord structure. On return, this structure contains the pattern information for the source style object.
function result
A copy of the gxPatternRecord structure associated with the
source style object.
DESCRIPTION
The GXGetStylePattern function returns as its function result, and in the pattern parameter, a pointer to a gxPatternRecord structure containing the pattern information for the style object specified by the source parameter.

This function creates a new shape to encapsulate the pattern geometry, and places a reference to this shape in the pattern field of the returned gxPatternRecord structure. You should dispose of this shape when you no longer need it.

Since this function copies the pattern information from the source style, you may make changes to the gxPatternRecord structure returned by this function without affecting the source style's pattern information. If you want to change the pattern information in the source style, you must use the GXSetStylePattern function.

SPECIAL CONSIDERATIONS
Unless an error results, the GXGetStylePattern function creates a shape; you are responsible for disposing of this shape when you no longer need it. See Inside Macintosh: QuickDraw GX Objects for information about disposing of QuickDraw GX objects.

ERRORS, WARNINGS, AND NOTICES
Errors
out_of_memory
style_is_nil
parameter_is_nil
SEE ALSO
For a discussion of patterns, see "Patterns" on page 3-31.

For examples of adding patterns to shapes, see page 3-86 through page 3-91.

For a discussion of the gxPatternRecord structure and a description of what types of shapes you can use as pattern shapes, see "The Pattern Structure" on page 3-106.

To specify pattern information for a style object, use the GXSetStylePattern function, which is described in the next section.

To retrieve pattern information from a style object associated with a particular shape, use the GXGetShapePattern function, which is described on page 3-145. To specify pattern information for a style object associated with a particular shape, use the GXSetShapePattern function, which is described on page 3-146.

To determine where pattern shapes are drawn for a particular shape, use the GXGetShapePatternPositions function, which is described on page 3-147.


Previous Book Contents Book Index Next

© Apple Computer, Inc.
7 JUL 1996




Navigation graphic, see text links

Main | Page One | What's New | Apple Computer, Inc. | Find It | Contact Us | Help